<template>
<div class="page" data-name="order-confirm">
  <div class="navbar">
    <div class="navbar-inner">
      <div class="left">
      	 <a href="#" class="link back">
           <i class="icon icon-back"></i>
         </a>
      </div>
      <div class="title">
      	我的订单
      </div>
      <div class="right">
      </div>
    </div>
  </div>
  <div class="page-content">
  	<div class="my-order-list-container">
				
	</div>	
  </div>
</template>


<script>

function listOrder(start,pagesize,type){
	  var  orderListResult = [{orderId:1},{orderId:2}];
      var recommendOrderListTemplate = $$('#orderListTemplate').html();
      var compiledRecommendOrderListTemplate = Template7.compile(recommendOrderListTemplate);
      var innerHTML = compiledRecommendOrderListTemplate({orderList:orderListResult});
       if(type=='ap'){//添加
      	 $$(".my-order-list-container").append(innerHTML);
       }else if(type=='rw'){
      	 $$(".my-order-list-container").html(innerHTML);
       }else{
     	  	app.dialog.alert("未知数据显示类型["+type+"]");
       }
}

  return {
    data: function () {
    	 var lotBatchListResult = [];
      return {
    	  lotBatchList: lotBatchListResult
      };
    },
  	on:{
  		 pageInit: function () {
  	        self = this;
  	        app = self.$app;
  	        router = self.$router;
  	        
  	        listOrder(0,10,"ap");
  	        
  	        
  	        
  	        $$(".orderListPayBtn").on('click',function(){
  	        	
	  	      	var paySheetTemplate = $$('#paySheetTemplate').html();
		    	var compiledPaySheetTemplate = Template7.compile(paySheetTemplate);
		    	var payInnerHTML = compiledPaySheetTemplate({});
	  	   		// Create dynamic Sheet
	  	    	var dynamicSheet = app.sheet.create({
	  	    	  content: payInnerHTML,
	  	    	  // Events
	  	    	  on: {
	  	    	    open: function (sheet) {
	  	    	      console.log('Sheet open');
	  	    	    },
	  	    	    opened: function (sheet) {
	  	    	      console.log('Sheet opened');
	  	    	    },
	  	    	  }
	  	    	});
	  	    	// Events also can be assigned on instance later
	  	    	dynamicSheet.on('close', function (sheet) {
	  	    	  console.log('Sheet close');
	  	    	});
	  	    	dynamicSheet.on('closed', function (sheet) {
	  	    	  console.log('Sheet closed');
	  	    	});
	  	    	
	  	    	dynamicSheet.open();
  	        	
  	        });
  	        
  	        
  	        $$(".cancleOrder").on('click',function(){
  	        	app.dialog.confirm("确定取消此订单么?","取消订单",function(){
  	        		alert("成功");
  	        	},function(){
  	        	});
  	        	
  	        	
  	        });
  	        
  		 }
  	}
	
  };
</script>
